<html>
<head><meta charset="utf-8"><title>Wishlist for `?`/`try{}`/`Try`? · project-error-handling · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/index.html">project-error-handling</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html">Wishlist for `?`/`try{}`/`Try`?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217720327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217720327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217720327">(Nov 24 2020 at 07:08)</a>:</h4>
<p>Hi folks!  I've been intending to write a new pre-RFC for making <code>Try</code> work differently to support some additional stuff.</p>
<p>The blog post made me think I should drop by here first to see if you have anything your group had been thinking about.</p>
<p>One thing on my list, for example, was that it would be nice to be able to write a type that can accept _any_ error type, rather than the <code>From</code> restrictions that currently exist.</p>



<a name="217801289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217801289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217801289">(Nov 24 2020 at 19:21)</a>:</h4>
<p>I'm interested but for the most part we've decided that <code>Try</code> and company are out of scope for this project grou</p>



<a name="217801319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217801319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217801319">(Nov 24 2020 at 19:21)</a>:</h4>
<p>thats more of a lang team thing, but I'm curious what you mean by "accept any error type rather than with From restrictions"</p>



<a name="217829888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217829888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217829888">(Nov 24 2020 at 23:59)</a>:</h4>
<p>Right now <code>Result&lt;_, E&gt;</code> -&gt; <code>Result&lt;_, F&gt;</code> in <code>?</code> needs <code>F: From&lt;E&gt;</code>, but it's hard to add blankets to that.  I was imagining, for example, a type that could be used in main that would allow essentially anything to be <code>?</code>'d.</p>



<a name="217829926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217829926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217829926">(Nov 24 2020 at 23:59)</a>:</h4>
<p>sure</p>



<a name="217830003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217830003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217830003">(Nov 25 2020 at 00:00)</a>:</h4>
<p>and this is kinda what <code>anyhow::Error</code> / <code>eyre::Report</code> do, though they explicitly don't impl <code>Error</code> to manage it</p>



<a name="217830026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217830026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217830026">(Nov 25 2020 at 00:00)</a>:</h4>
<p>i guess,</p>



<a name="217830027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217830027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217830027">(Nov 25 2020 at 00:00)</a>:</h4>
<p>go on?</p>



<a name="217830073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/217830073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#217830073">(Nov 25 2020 at 00:00)</a>:</h4>
<p>like, how would you modify <code>Try</code> to manage this, and how does it differ from <code>Box&lt;dyn Error&gt;</code> and similar types</p>



<a name="218272651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218272651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218272651">(Nov 30 2020 at 11:00)</a>:</h4>
<p>Last time I tried <code>try {}</code> I remember it didn't infer types when I expected it to. Not sure if that's still the case tho.</p>



<a name="218274821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218274821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218274821">(Nov 30 2020 at 11:22)</a>:</h4>
<p>does break-to-labeled-block fall under this category? This is really the core functionality that I need when there are multiple <code>try {}</code> scopes in play at once. (Also break inside a closure, although that seems harder.)</p>



<a name="218282776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218282776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218282776">(Nov 30 2020 at 12:59)</a>:</h4>
<p>I think most of the other things on my wishlist for <code>Try</code>/ <code>try {}</code> are all future extensions:</p>
<ul>
<li>creating new errors in a <code>try</code> context using <code>throw</code></li>
<li>error recovery using <code>catch(kind) {}</code> or <code>match {}</code></li>
<li>some way to declare closures with <code>try {}</code> semantics</li>
<li>and some way to do that for functions too (possibly <code>throws</code>)</li>
</ul>



<a name="218283495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218283495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218283495">(Nov 30 2020 at 13:06)</a>:</h4>
<p>Particularly in Tide endpoint examples the combination of async + errors becomes real noisy. Example:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="sd">//! HTTP echo server</span>

<span class="c1">// current</span>
<span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">app</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tide</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="n">app</span><span class="p">.</span><span class="n">at</span><span class="p">(</span><span class="s">"/echo"</span><span class="p">).</span><span class="n">post</span><span class="p">(</span><span class="o">|</span><span class="n">req</span><span class="o">|</span><span class="w"> </span><span class="k">async</span><span class="w"> </span><span class="k">move</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nb">Ok</span><span class="p">(</span><span class="n">req</span><span class="p">)});</span><span class="w"></span>
<span class="n">app</span><span class="p">.</span><span class="n">listen</span><span class="p">(</span><span class="s">"127.0.0.1:8080"</span><span class="p">).</span><span class="k">await</span><span class="o">?</span><span class="p">;</span><span class="w"></span>
<span class="nb">Ok</span><span class="p">(())</span><span class="w"></span>

<span class="c1">// desired</span>
<span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">app</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tide</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="n">app</span><span class="p">.</span><span class="n">at</span><span class="p">(</span><span class="s">"/echo"</span><span class="p">).</span><span class="n">post</span><span class="p">(</span><span class="k">async</span><span class="w"> </span><span class="k">try</span><span class="w"> </span><span class="o">|</span><span class="n">req</span><span class="o">|</span><span class="w"> </span><span class="n">req</span><span class="p">);</span><span class="w"></span>
<span class="n">app</span><span class="p">.</span><span class="n">listen</span><span class="p">(</span><span class="s">"127.0.0.1:8080"</span><span class="p">).</span><span class="k">await</span><span class="o">?</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="218333259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218333259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218333259">(Nov 30 2020 at 19:25)</a>:</h4>
<p>In that particular case, it doesn't seem like try makes it any less noisy.</p>



<a name="218333312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218333312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218333312">(Nov 30 2020 at 19:25)</a>:</h4>
<p>You remove Ok(req) in favor of req, but then have to add try.</p>



<a name="218333381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218333381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218333381">(Nov 30 2020 at 19:26)</a>:</h4>
<p>It's not obvious why you need try closures for that, rather than just a try block.</p>



<a name="218341908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218341908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218341908">(Nov 30 2020 at 20:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211722">Yoshua Wuyts</span> <a href="#narrow/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F/near/218272651">said</a>:</p>
<blockquote>
<p>Last time I tried <code>try {}</code> I remember it didn't infer types when I expected it to. Not sure if that's still the case tho.</p>
</blockquote>
<p>Yeah, <code>?</code> loses the "result-ness" of things.  I'd like to do something about that, though error-conversion makes it hard in general.</p>



<a name="218344375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218344375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218344375">(Nov 30 2020 at 20:53)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> I'd like to see that as well, but I'm wondering if there's any forward-compatible way we could go ahead and start supporting <code>try</code> blocks now, even if they usually need some help figuring out their return type, and <em>later</em> figure out a way to do better inference.</p>



<a name="218344423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218344423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218344423">(Nov 30 2020 at 20:53)</a>:</h4>
<p>What do you see as the current blockers for <code>try</code> blocks, if we don't try to improve inference?</p>



<a name="218408778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218408778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218408778">(Dec 01 2020 at 11:26)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> ah, I think there may be a difference between the experience <em>reading</em> and the experience <em>writing</em><br>
 -- I agree they indeed look similar enough, but writing <code>async |x| try { }</code> instead of <code>async try |x|</code> feels messier. Mixing keywords in front of the closure, after the closure, brackets where a regular closure requires none. It'd be nice if eventually this could be smoothed out.</p>



<a name="218442234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218442234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218442234">(Dec 01 2020 at 16:04)</a>:</h4>
<p>I understand, but I don't personally think that that motivates adding a new kind of closure.</p>



<a name="218447627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218447627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218447627">(Dec 01 2020 at 16:38)</a>:</h4>
<p><em>personally</em>, I think <code>async move { Ok(req) }</code> is the most clear out of any of those</p>



<a name="218447650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218447650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218447650">(Dec 01 2020 at 16:38)</a>:</h4>
<p>but I can see how it would be annoying if you have to write it a lot</p>



<a name="218447793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218447793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218447793">(Dec 01 2020 at 16:39)</a>:</h4>
<p>FWIW, I would be more amenable to the idea of omitting braces in specific circumstances than I would be towards introducing a new kind of closure.</p>



<a name="218447931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218447931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218447931">(Dec 01 2020 at 16:40)</a>:</h4>
<p>For instance, async try {} rather than async { try { } }.</p>



<a name="218462386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218462386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218462386">(Dec 01 2020 at 18:28)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F/near/218344423">said</a>:</p>
<blockquote>
<p>What do you see as the current blockers for <code>try</code> blocks, if we don't try to improve inference?</p>
</blockquote>
<p>No hard blockers (given the possibility of edition changes), just forward hazards -- if we wanted the default to be more restrictive to be able to infer better, for example.</p>



<a name="218463655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218463655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218463655">(Dec 01 2020 at 18:39)</a>:</h4>
<p>personally I would love for try <em>not</em> to use <code>Into</code> for converting errors</p>



<a name="218463684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218463684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218463684">(Dec 01 2020 at 18:39)</a>:</h4>
<p>that's a backwards-compatible way to get rid of type inference issues and also decrease some of the codegen bloat</p>



<a name="218472905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218472905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218472905">(Dec 01 2020 at 19:56)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> That seems reasonable to me; as long as <code>?</code> still uses <code>Into</code>, <code>try</code> doesn't need to.</p>



<a name="218478633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218478633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218478633">(Dec 01 2020 at 20:43)</a>:</h4>
<p><code>try</code> <em>doesn't</em> use <code>Into</code> today.  All that <code>try</code> does is the ok-wrap (and where it breaks to)</p>



<a name="218478769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/Wishlist%20for%20%60%3F%60/%60try%7B%7D%60/%60Try%60%3F/near/218478769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/Wishlist.20for.20.60.3F.60.2F.60try.7B.7D.60.2F.60Try.60.3F.html#218478769">(Dec 01 2020 at 20:44)</a>:</h4>
<p>I think it's the <code>Into</code> (well, <code>From</code>, technically) in the <code>?</code> that needs to not happen to get the inference under control.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>